Skip to content

Conversation

@lentzi90
Copy link
Contributor

@lentzi90 lentzi90 commented Oct 7, 2025

What this PR does / why we need it:

This is a manual backport.
This commit changes how we run and build codegen.
Instead of using a script inside the openapi-gen package, we now build and call the binary directly. This avoids issues where the upstream package is incompatible with the go version we use.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #2742

Special notes for your reviewer:

  1. Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

TODOs:

  • squashed commits
  • if necessary:
    • includes documentation
    • adds unit tests

/hold

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 7, 2025
@netlify
Copy link

netlify bot commented Oct 7, 2025

Deploy Preview for kubernetes-sigs-cluster-api-openstack ready!

Name Link
🔨 Latest commit ee66016
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-cluster-api-openstack/deploys/68e505f5ac8e670008c41d5f
😎 Deploy Preview https://deploy-preview-2762--kubernetes-sigs-cluster-api-openstack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 7, 2025
This is a manual backport.
This commit changes how we run and build codegen.
Instead of using a script inside the openapi-gen package, we now build and call the binary directly.
This avoids issues where the upstream package is incompatible with the go version we use.

Minor changes to generated code:
- api_violations.report: One additional violation detected by newer gengo
- zz_generated.openapi.go: Backslash escaping difference (cosmetic)

Signed-off-by: Lennart Jern <[email protected]>
@lentzi90 lentzi90 force-pushed the lentzi90/codegen-release-0.12 branch from 1c7236b to ee66016 Compare October 7, 2025 12:22
@lentzi90
Copy link
Contributor Author

lentzi90 commented Oct 7, 2025

Ok looks like it works now. I had to downgrade kustomize to get things working.
We have some issue with gengo and codegen from before, and kustomize ties in to this since it depends on kube-openapi.
Luckily we don't have this issue on main anymore.

// Remove it once we have a new version of code-generator that is compatible with latest gengo.
// See https://github.com/kubernetes/gengo/issues/286
replace k8s.io/gengo/v2 => k8s.io/gengo/v2 v2.0.0-20240228010128-51d4e06bde70

@lentzi90 lentzi90 mentioned this pull request Oct 8, 2025
3 tasks
@lentzi90
Copy link
Contributor Author

lentzi90 commented Oct 8, 2025

Keeping hold until we have discussed and merged #2761.

@lentzi90
Copy link
Contributor Author

lentzi90 commented Oct 8, 2025

Main PR merged.
/hold cancel
/approve
/cc @smoshiur1237

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 8, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lentzi90

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 8, 2025
Copy link
Contributor

@smoshiur1237 smoshiur1237 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 9, 2025
@k8s-ci-robot k8s-ci-robot merged commit 0722d7c into kubernetes-sigs:release-0.12 Oct 9, 2025
9 checks passed
@github-project-automation github-project-automation bot moved this from Inbox to Done in CAPO Roadmap Oct 9, 2025
@lentzi90 lentzi90 deleted the lentzi90/codegen-release-0.12 branch October 9, 2025 12:30
@lentzi90
Copy link
Contributor Author

We are not really supporting release-0.11, but if this can be automatically backported I am willing to do it to keep the tests green.
/cherry-pick release-0.11

@k8s-infra-cherrypick-robot

@lentzi90: #2762 failed to apply on top of branch "release-0.11":

Applying: Refactor generate-codegen
Using index info to reconstruct a base tree...
M	Makefile
M	hack/tools/Makefile
M	hack/tools/go.mod
M	hack/tools/go.sum
M	hack/update-codegen.sh
Falling back to patching base and 3-way merge...
CONFLICT (modify/delete): hack/update-codegen.sh deleted in Refactor generate-codegen and modified in HEAD. Version HEAD of hack/update-codegen.sh left in tree.
Auto-merging hack/tools/go.sum
CONFLICT (content): Merge conflict in hack/tools/go.sum
Auto-merging hack/tools/go.mod
CONFLICT (content): Merge conflict in hack/tools/go.mod
Auto-merging hack/tools/Makefile
Auto-merging Makefile
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0001 Refactor generate-codegen

In response to this:

We are not really supporting release-0.11, but if this can be automatically backported I am willing to do it to keep the tests green.
/cherry-pick release-0.11

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants